﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;

namespace StatesAndEventsTest.source
{
    public class StateEngine
    {
        // Members
        Dictionary<string, BaseState> mStates;

        // Functions
        public StateEngine()
        {
            mStates = new Dictionary<string, BaseState>();   
        }
        public void InstallState(BaseState state)
        {
            if (!mStates.ContainsKey(state.Name))
            {
                state.Init();
                mStates.Add(state.Name, state);
            }
        }

        public BaseState GetState(string stateName)
        {
            if (mStates.ContainsKey(stateName))
            {
                return mStates[stateName];
            }
            else
            {
                return null;
            }
        }
    }
}
